<%@page contentType="text/html; charset=UTF-8"%>
<%@taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@include file="/common/definition.jsp"%>

<html:html>
<tiles:insert beanName="admin-definition" flush="true">
	<tiles:put name="title"> Administrator Management </tiles:put>
	<tiles:put name="body" type="string">
		<div class="row">
			<div class="col-md-3">
				<div class="muted">Danh Mục</div>
				<div class="dropdown clearfix">
					<ul class="dropdown-menu"
						style="display: block; position: static; margin-bottom: 5px; *width: 180px;">
						<s:if test="productModel.listSubcat != null">
							<s:iterator value="productModel.listSubcat" id="list">
								<li class="dropdown-submenu"><a><s:property
											value="catName" /> </a>
									<ul>
										<s:iterator value="listinfo" id="list1">
											<li><s:a action="viewCategories">
													<s:property value="catName" />
													<s:param name="catID" value="catID"></s:param>
												</s:a>
											</li>
										</s:iterator>
									</ul></li>
							</s:iterator>
						</s:if>
						<s:else>
							<s:iterator value="listSubcat" id="list">
								<li class="dropdown-submenu"><a><s:property
											value="catName" /> </a>
									<ul>
										<s:iterator value="listinfo" id="list1">
											<li><s:a action="viewCategories">
													<s:property value="catName" />
													<s:param name="catID" value="catID"></s:param>
												</s:a>
											</li>
										</s:iterator>
									</ul>
								</li>
							</s:iterator>
						</s:else>
					</ul>
				</div>
			</div>
			
		
					<div class="col-md-4">
						<s:form action="editCategories" theme="simple">
							<div class="form-group">
								<label class="contact"><strong>Danh Mục ID:</strong> </label>
								<s:textfield name="catInfo.catID" cssClass="form-control" disabled="true"></s:textfield>
							</div>
							<div class="form-group">
								<label class="contact"><strong>Tên Danh Mục:</strong> </label>
								<s:textfield name="catInfo.catName" cssClass="form-control"></s:textfield>
							</div>
							<div class="form-group">
								<label class="contact"><strong>Danh Mục:</strong> </label> <select
									name="catInfo.subOf" class="form-control"
									tabindex="0">
									<s:if test="catID != null || productModel.catID != null">
										<s:iterator value="productModel.listCatInfo">
											<option value='<s:property value="catID"/>'>
												<s:property value="catName" />
											</option>
										</s:iterator>
										<s:iterator value="listCatInfo">
											<option value='<s:property value="catID"/>'>
												<s:property value="catName" />
											</option>
										</s:iterator></s:if>
								</select>
							</div>
							<div class="pull-right">
								<button class="btn btn-primary">Edit</button>
								<button type="reset" class="btn btn-default">Clear</button>
							</div>
						</s:form>

					</div>
	</tiles:put>
</tiles:insert>
</html:html>

<script type="text/javascript">
	function switchAction(formId, action) {
		$('#' + formId).attr('action', action);
		$.post(action);
	}
</script>
